home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14870 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6c 6f | 63 75 74 75 73 2e 72 63 |Path: lo|cutus.rc|
|00000010| 68 6c 61 6e 64 2e 69 62 | 6d 2e 63 6f 6d 21 75 73 |hland.ib|m.com!us|
|00000020| 65 6e 65 74 0a 46 72 6f | 6d 3a 20 50 68 69 6c 69 |enet.Fro|m: Phili|
|00000030| 70 20 53 74 61 69 74 65 | 20 3c 70 73 74 61 69 74 |p Staite| <pstait|
|00000040| 65 2b 40 72 63 68 6c 61 | 6e 64 2e 69 62 6d 2e 63 |e+@rchla|nd.ibm.c|
|00000050| 6f 6d 3e 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |om>.News|groups: |
|00000060| 63 6f 6d 70 2e 6c 61 6e | 67 2e 63 2b 2b 0a 53 75 |comp.lan|g.c++.Su|
|00000070| 62 6a 65 63 74 3a 20 52 | 65 3a 20 50 72 6f 62 6c |bject: R|e: Probl|
|00000080| 65 6d 20 77 69 74 68 20 | 63 6f 70 79 20 63 6f 6e |em with |copy con|
|00000090| 73 74 72 75 63 74 6f 72 | 20 69 6e 20 64 65 72 69 |structor| in deri|
|000000a0| 76 65 64 20 63 6c 61 73 | 73 0a 44 61 74 65 3a 20 |ved clas|s.Date: |
|000000b0| 54 75 65 2c 20 30 32 20 | 41 70 72 20 31 39 39 36 |Tue, 02 |Apr 1996|
|000000c0| 20 30 37 3a 32 39 3a 31 | 34 20 2d 30 36 30 30 0a | 07:29:1|4 -0600.|
|000000d0| 4f 72 67 61 6e 69 7a 61 | 74 69 6f 6e 3a 20 49 42 |Organiza|tion: IB|
|000000e0| 4d 20 52 6f 63 68 65 73 | 74 65 72 2c 20 4d 4e 0a |M Roches|ter, MN.|
|000000f0| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 33 31 36 |Message-|ID: <316|
|00000100| 31 32 42 41 41 2e 34 34 | 36 42 40 72 63 68 6c 61 |12BAA.44|6B@rchla|
|00000110| 6e 64 2e 69 62 6d 2e 63 | 6f 6d 3e 0a 52 65 66 65 |nd.ibm.c|om>.Refe|
|00000120| 72 65 6e 63 65 73 3a 20 | 3c 62 66 6f 72 6e 65 79 |rences: |<bforney|
|00000130| 2d 30 31 30 34 39 36 32 | 32 32 38 31 39 30 30 30 |-0104962|22819000|
|00000140| 31 40 67 72 69 6d 6d 79 | 2e 72 65 73 68 61 6c 6c |1@grimmy|.reshall|
|00000150| 2e 75 6d 69 63 68 2e 65 | 64 75 3e 0a 4e 4e 54 50 |.umich.e|du>.NNTP|
|00000160| 2d 50 6f 73 74 69 6e 67 | 2d 48 6f 73 74 3a 20 70 |-Posting|-Host: p|
|00000170| 6f 77 65 72 74 6f 6f 6c | 2e 72 63 68 6c 61 6e 64 |owertool|.rchland|
|00000180| 2e 69 62 6d 2e 63 6f 6d | 0a 4d 69 6d 65 2d 56 65 |.ibm.com|.Mime-Ve|
|00000190| 72 73 69 6f 6e 3a 20 31 | 2e 30 0a 43 6f 6e 74 65 |rsion: 1|.0.Conte|
|000001a0| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|000001b0| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 75 73 2d |ain; cha|rset=us-|
|000001c0| 61 73 63 69 69 0a 43 6f | 6e 74 65 6e 74 2d 54 72 |ascii.Co|ntent-Tr|
|000001d0| 61 6e 73 66 65 72 2d 45 | 6e 63 6f 64 69 6e 67 3a |ansfer-E|ncoding:|
|000001e0| 20 37 62 69 74 0a 58 2d | 4d 61 69 6c 65 72 3a 20 | 7bit.X-|Mailer: |
|000001f0| 4d 6f 7a 69 6c 6c 61 20 | 32 2e 30 31 20 28 58 31 |Mozilla |2.01 (X1|
|00000200| 31 3b 20 49 3b 20 41 49 | 58 20 31 29 0a 54 6f 3a |1; I; AI|X 1).To:|
|00000210| 20 42 72 69 61 6e 20 46 | 6f 72 6e 65 79 20 3c 62 | Brian F|orney <b|
|00000220| 66 6f 72 6e 65 79 40 75 | 6d 69 63 68 2e 65 64 75 |forney@u|mich.edu|
|00000230| 3e 0a 0a 42 72 69 61 6e | 20 46 6f 72 6e 65 79 20 |>..Brian| Forney |
|00000240| 77 72 6f 74 65 3a 0a 3e | 20 0a 3e 20 48 65 6c 6c |wrote:.>| .> Hell|
|00000250| 6f 2e 20 49 27 6d 20 74 | 72 79 69 6e 67 20 74 6f |o. I'm t|rying to|
|00000260| 20 63 72 65 61 74 65 20 | 61 20 63 6f 70 79 20 63 | create |a copy c|
|00000270| 6f 6e 73 74 72 75 63 74 | 6f 72 20 66 6f 72 20 61 |onstruct|or for a|
|00000280| 20 64 65 72 69 76 65 64 | 20 63 6c 61 73 73 2e 20 | derived| class. |
|00000290| 54 68 65 0a 3e 20 62 61 | 73 65 20 63 6c 61 73 73 |The.> ba|se class|
|000002a0| 20 64 6f 65 73 20 6e 6f | 74 20 68 61 76 65 20 61 | does no|t have a|
|000002b0| 20 63 6f 70 79 20 63 6f | 6e 73 74 72 75 63 74 6f | copy co|nstructo|
|000002c0| 72 2c 20 73 6f 20 74 68 | 69 73 20 63 6f 75 6c 64 |r, so th|is could|
|000002d0| 20 62 65 20 61 20 70 72 | 6f 62 6c 65 6d 2e 0a 3e | be a pr|oblem..>|
|000002e0| 20 28 49 27 6d 20 72 65 | 61 6c 6c 79 20 6e 6f 74 | (I'm re|ally not|
|000002f0| 20 73 75 72 65 2e 29 20 | 43 61 6e 20 61 6e 79 6f | sure.) |Can anyo|
|00000300| 6e 65 20 74 65 6c 6c 20 | 6d 65 20 69 66 20 74 68 |ne tell |me if th|
|00000310| 65 20 62 61 73 65 20 63 | 6c 61 73 73 20 6e 65 65 |e base c|lass nee|
|00000320| 64 73 20 61 20 63 6f 70 | 79 0a 3e 20 63 6f 6e 73 |ds a cop|y.> cons|
|00000330| 74 72 75 63 74 6f 72 3f | 0a 0a 44 65 70 65 6e 64 |tructor?|..Depend|
|00000340| 73 20 6f 6e 20 77 68 61 | 74 20 69 73 20 69 6e 20 |s on wha|t is in |
|00000350| 74 68 65 20 62 61 73 65 | 20 63 6c 61 73 73 2e 20 |the base| class. |
|00000360| 20 49 66 20 69 74 20 69 | 73 20 22 73 69 6d 70 6c | If it i|s "simpl|
|00000370| 65 22 20 64 61 74 61 20 | 61 6e 64 0a 63 6f 6e 74 |e" data |and.cont|
|00000380| 61 69 6e 65 64 20 6f 62 | 6a 65 63 74 73 20 77 69 |ained ob|jects wi|
|00000390| 74 68 20 63 6f 70 79 20 | 63 6f 6e 73 74 72 75 63 |th copy |construc|
|000003a0| 74 6f 72 73 20 74 68 65 | 6e 20 70 72 6f 62 61 62 |tors the|n probab|
|000003b0| 6c 79 20 6e 6f 74 2e 20 | 28 74 68 61 74 20 69 73 |ly not. |(that is|
|000003c0| 2c 0a 74 68 65 20 63 6f | 6d 70 69 6c 65 72 20 64 |,.the co|mpiler d|
|000003d0| 65 66 61 75 6c 74 20 77 | 69 6c 6c 20 62 65 20 6f |efault w|ill be o|
|000003e0| 6b 29 0a 0a 49 66 20 74 | 68 65 72 65 20 61 72 65 |k)..If t|here are|
|000003f0| 20 72 65 73 6f 75 72 63 | 65 20 61 6c 6c 6f 63 61 | resourc|e alloca|
|00000400| 74 69 6f 6e 73 20 65 74 | 63 2e 20 74 68 61 74 20 |tions et|c. that |
|00000410| 6f 63 63 75 72 2c 20 70 | 6f 69 6e 74 65 72 73 2f |occur, p|ointers/|
|00000420| 72 65 66 65 72 65 6e 63 | 65 73 0a 74 6f 20 6d 61 |referenc|es.to ma|
|00000430| 69 6e 74 61 69 6e 20 65 | 74 63 2e 20 74 68 65 6e |intain e|tc. then|
|00000440| 20 79 6f 75 20 70 72 6f | 62 61 62 6c 79 20 6e 65 | you pro|bably ne|
|00000450| 65 64 20 6f 6e 65 20 66 | 6f 72 20 74 68 65 20 62 |ed one f|or the b|
|00000460| 61 73 65 20 63 6c 61 73 | 73 2e 0a 20 0a 3e 20 49 |ase clas|s.. .> I|
|00000470| 20 73 74 61 72 74 65 64 | 20 74 6f 20 63 6f 6e 73 | started| to cons|
|00000480| 69 64 65 72 20 74 68 65 | 20 6c 61 63 6b 20 6f 66 |ider the| lack of|
|00000490| 20 61 20 63 6f 70 79 20 | 63 6f 6e 73 74 72 75 63 | a copy |construc|
|000004a0| 74 6f 72 20 69 6e 20 74 | 68 65 20 62 61 73 65 20 |tor in t|he base |
|000004b0| 63 6c 61 73 73 20 61 0a | 3e 20 70 72 6f 62 6c 65 |class a.|> proble|
|000004c0| 6d 20 77 68 65 6e 20 4d | 65 74 72 6f 77 65 72 6b |m when M|etrowerk|
|000004d0| 73 20 38 27 73 20 43 2b | 2b 20 63 6f 6d 70 69 6c |s 8's C+|+ compil|
|000004e0| 65 72 20 64 69 73 70 6c | 61 79 65 64 20 74 68 69 |er displ|ayed thi|
|000004f0| 73 20 77 61 72 6e 69 6e | 67 3a 0a 3e 20 0a 3e 20 |s warnin|g:.> .> |
|00000500| 45 72 72 6f 72 20 20 20 | 3a 20 63 61 6e 6e 6f 74 |Error |: cannot|
|00000510| 20 63 6f 6e 73 74 72 75 | 63 74 20 62 61 73 65 20 | constru|ct base |
|00000520| 63 6c 61 73 73 20 27 4c | 41 72 72 61 79 27 0a 3e |class 'L|Array'.>|
|00000530| 20 55 55 72 6c 2e 63 70 | 20 6c 69 6e 65 20 32 37 | UUrl.cp| line 27|
|00000540| 20 20 20 7d 0a 3e 20 0a | 3e 20 48 65 72 65 27 73 | }.> .|> Here's|
|00000550| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 20 69 6e | the fun|ction in|
|00000560| 20 77 68 69 63 68 20 74 | 68 65 20 65 72 72 6f 72 | which t|he error|
|00000570| 20 6f 63 63 75 72 73 3a | 0a 3e 20 0a 3e 20 4c 55 | occurs:|.> .> LU|
|00000580| 72 6c 41 72 72 61 79 3a | 3a 4c 55 72 6c 41 72 72 |rlArray:|:LUrlArr|
|00000590| 61 79 28 63 6f 6e 73 74 | 20 4c 55 72 6c 41 72 72 |ay(const| LUrlArr|
|000005a0| 61 79 20 26 69 6e 41 72 | 72 61 79 29 0a 3e 20 7b |ay &inAr|ray).> {|
|000005b0| 0a 3e 20 20 20 20 43 6f | 70 79 57 68 6f 6c 65 41 |.> Co|pyWholeA|
|000005c0| 72 72 61 79 28 69 6e 41 | 72 72 61 79 29 3b 0a 3e |rray(inA|rray);.>|
|000005d0| 20 7d 0a 0a 4e 6f 74 65 | 2c 20 74 68 69 73 20 69 | }..Note|, this i|
|000005e0| 73 20 63 61 6c 6c 69 6e | 67 20 28 6f 72 20 61 74 |s callin|g (or at|
|000005f0| 74 65 6d 70 74 69 6e 67 | 20 74 6f 20 63 61 6c 6c |tempting| to call|
|00000600| 29 20 74 68 65 20 64 65 | 66 61 75 6c 74 0a 28 70 |) the de|fault.(p|
|00000610| 61 72 61 6d 65 74 65 72 | 6c 65 73 73 29 20 63 6f |arameter|less) co|
|00000620| 6e 73 74 72 75 63 74 6f | 72 20 6f 6e 20 74 68 65 |nstructo|r on the|
|00000630| 20 62 61 73 65 20 63 6c | 61 73 73 2e 20 20 59 6f | base cl|ass. Yo|
|00000640| 75 20 70 72 6f 62 61 62 | 6c 79 20 77 61 6e 74 3a |u probab|ly want:|
|00000650| 0a 0a 4c 55 72 6c 41 72 | 72 61 79 3a 3a 4c 55 72 |..LUrlAr|ray::LUr|
|00000660| 6c 41 72 72 61 79 28 20 | 63 6f 6e 73 74 20 4c 55 |lArray( |const LU|
|00000670| 72 6c 41 72 72 61 79 26 | 20 69 6e 41 72 72 61 79 |rlArray&| inArray|
|00000680| 20 29 20 3a 20 62 61 73 | 65 43 6c 61 73 73 28 20 | ) : bas|eClass( |
|00000690| 69 6e 41 72 72 61 79 20 | 29 0a 7b 0a 20 20 20 20 |inArray |).{. |
|000006a0| 43 6f 70 79 57 68 6f 6c | 65 41 72 72 61 79 28 20 |CopyWhol|eArray( |
|000006b0| 69 6e 41 72 72 61 79 20 | 29 3b 0a 7d 0a 0a 57 68 |inArray |);.}..Wh|
|000006c0| 65 72 65 20 22 62 61 73 | 65 43 6c 61 73 73 22 20 |ere "bas|eClass" |
|000006d0| 69 73 20 74 68 65 20 72 | 65 61 6c 20 6e 61 6d 65 |is the r|eal name|
|000006e0| 20 6f 66 20 77 68 61 74 | 65 76 65 72 20 62 61 73 | of what|ever bas|
|000006f0| 65 20 63 6c 61 73 73 20 | 4c 55 72 6c 41 72 72 61 |e class |LUrlArra|
|00000700| 79 20 69 73 0a 64 65 72 | 69 76 65 64 20 66 72 6f |y is.der|ived fro|
|00000710| 6d 2e 20 20 54 68 69 73 | 20 74 65 6c 6c 73 20 74 |m. This| tells t|
|00000720| 68 65 20 63 6f 6d 70 69 | 6c 65 72 20 74 6f 20 75 |he compi|ler to u|
|00000730| 73 65 20 74 68 65 20 63 | 6f 70 79 20 63 6f 6e 73 |se the c|opy cons|
|00000740| 74 72 75 63 74 6f 72 20 | 28 6f 72 0a 67 65 6e 65 |tructor |(or.gene|
|00000750| 72 61 74 65 20 6f 6e 65 | 29 20 66 6f 72 20 74 68 |rate one|) for th|
|00000760| 65 20 62 61 73 65 20 63 | 6c 61 73 73 20 77 68 65 |e base c|lass whe|
|00000770| 6e 20 63 6f 70 79 20 63 | 6f 6e 73 74 72 75 63 74 |n copy c|onstruct|
|00000780| 69 6e 67 20 61 20 64 65 | 72 69 76 65 64 20 63 6c |ing a de|rived cl|
|00000790| 61 73 73 2e 0a 0a 2d 2d | 20 0a 0a 50 68 69 6c 20 |ass...--| ..Phil |
|000007a0| 53 74 61 69 74 65 2c 20 | 28 35 30 37 29 20 32 35 |Staite, |(507) 25|
|000007b0| 33 2d 32 35 32 39 2c 20 | 74 65 61 6d 20 4f 53 2f |3-2529, |team OS/|
|000007c0| 32 0a 69 6e 74 65 72 6e | 65 74 3a 20 70 73 74 61 |2.intern|et: psta|
|000007d0| 69 74 65 40 76 6e 65 74 | 2e 69 62 6d 2e 63 6f 6d |ite@vnet|.ibm.com|
|000007e0| 20 20 69 6e 74 65 72 6e | 61 6c 3a 20 70 73 74 61 | intern|al: psta|
|000007f0| 69 74 65 40 72 63 68 6c | 61 6e 64 0a |ite@rchl|and. |
+--------+-------------------------+-------------------------+--------+--------+